<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()
</script>
<template>
  <div class="footer">
    <div class="nav">
      <div
        :class="['item', { active: $route.path === '/plant' }]"
        @click="router.push('/plant')"
      ></div>
      <div
        :class="['item', { active: $route.path === '/process' }]"
        @click="router.push('/process')"
      ></div>
      <div
        :class="['item', { active: $route.path === '/flow' }]"
        @click="router.push('/flow')"
      ></div>
      <div
        :class="['item', { active: $route.path === '/brand' }]"
        @click="router.push('/brand')"
      ></div>
      <div
        :class="['item', { active: $route.path === '/culture' }]"
        @click="router.push('/culture')"
      ></div>
      <div
        :class="['item', { active: $route.path === '/service' }]"
        @click="router.push('/service')"
      ></div>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-image: url('@/assets/images/footer/page-footer.png');
  background-size: cover;
  background-repeat: no-repeat;
  height: 80px;
  pointer-events: all;
  .nav {
    position: absolute;
    top: 0;
    left: 50%;
    width: 720px;
    height: 115px;
    transform: translate(-50%, -70%);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    .item {
      width: 100px;
      height: 115px;
      background-size: cover;
      background-repeat: no-repeat;
      background-position: center;
      cursor: pointer;
      @for $i from 1 through 6 {
        &:nth-child(#{$i}) {
          background-image: url('@/assets/images/footer/nav-#{$i}.png');
        }
        &:nth-child(#{$i}):hover,
        &:nth-child(#{$i}).active {
          width: 100px;
          height: 132px;
          background-image: url('@/assets/images/footer/active/nav-#{$i}.png');
        }
      }
    }
  }
}
</style>
